#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;

class Solution1 {
public:
    vector<vector<int>> diagonalSort(vector<vector<int>>& mat) {
        int n = mat.size(), m = mat[0].size();
        vector<vector<int>> vs;
        for (int i = n - 1; i >= 0; --i)
        {
            vector<int> tmp;
            for (int j = 0, k = i; j < m && k < n; ++j, ++k)
                tmp.push_back(mat[k][j]);
            vs.push_back(std::move(tmp));
        }
        for (int j = 1; j < m; ++j)
        {
            vector<int> tmp;
            for (int i = 0, k = j; i < n && k < m; ++i, ++k)
                tmp.push_back(mat[i][k]);
            vs.push_back(std::move(tmp));
        }
        int pos = 0;
        for (int i = n - 1; i >= 0; --i)
        {
            sort(vs[pos].begin(), vs[pos].end());
            int index = 0;
            for (int j = 0, k = i; j < m && k < n; ++j, ++k)
                mat[k][j] = vs[pos][index++];
            pos++;
        }
        for (int j = 1; j < m; ++j)
        {
            sort(vs[pos].begin(), vs[pos].end());
            int index = 0;
            for (int i = 0, k = j; i < n && k < m; ++i, ++k)
                mat[i][k] = vs[pos][index++];
            pos++;
        }
        return mat;
    }
};

#include <cstring>
#include <set>
#include <queue>


int main()
{
    int n, m;
    cin >> n >> m;
    vector<vector<int>> g(n + 1);
    vector<int> in(n + 1);
    while (m--)
    {
        int u, v;
        cin >> u >> v;
        g[u].push_back(v);
        ++in[v];
    }

    queue<int> q;
    for (int i = 1; i <= n; ++i)
        if (in[i] == 0)
            q.push(i);

    vector<int> ans;
    while (!q.empty())
    {
        int cur = q.front(); q.pop();
        ans.push_back(cur);
        for (int out : g[cur])
            if (--in[out] == 0)
                q.push(out);
    }

    if (ans.size() != n)
    {
        cout << -1 << endl;
        return 0;
    }

    for (int i = 0; i < n; ++i)
    {
        if (i != n - 1)
            cout << ans[i] << ' ';
        else
            cout << ans[i] << endl;
    }

    return 0;
}